<script type="text/javascript">

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', '{{$tracker->tracking_id}}']);
    document.write(_gaq.push(['_trackPageview']));

{{if $tracker->ecommerce_tracking}}
    _gaq.push(['_addTrans',
      '1234',           // order ID - required
      'Mountain View',  // affiliation or store name
      '11.99',          // total - required
      '1.29',           // tax
      '5',              // shipping
      'San Jose',       // city
      'California',     // state or province
      'USA'             // country
    ]);
    _gaq.push(['_addItem',
      '1234',           // order ID - required
      'DD44',           // SKU/code
      'T-Shirt',        // product name
      'Green Medium',   // category or variation
      '11.99',          // unit price - required
      '1'               // quantity - required
    ]);
    _gaq.push(['_trackTrans']);
{{/if}}

{{if $tracker->event_tracking}}
    <a onclick="_gaq.push(['_trackEvent', 'category', 'action', 'opt_label', opt_value]);">click me</a>
{{/if}}

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
